Posts by b3r3ch1t • 805 points
46 posts
-
0
votes0
answers37
viewsQ: Data protection against changes in Mysql
I need to protect a system’s data against database changes. It’s a system that uses financial transactions. I need a mechanism to prevent someone with access to the database from making changes to…
-
0
votes0
answers155
viewsQ: Decimal with ASP.NET Core 2.2
I have an ASP.NET Core 2.2 project with the following configuration in the Startup class var cultureInfo = new CultureInfo("pt-BR"); CultureInfo.DefaultThreadCurrentCulture = cultureInfo;…
-
3
votes1
answer247
viewsQ: Convert SQL to LINQ
How do I convert the SQL below to LINQ? SELECT `clientes`.`Nome`, `clientes`.`Cpf`, `clientes`.`email`, `clientes`.`Id` as clienteId, `cartoes`.`Id` as CartaoId,…
-
2
votes1
answer515
viewsQ: Integration Test . Net Core 2.2
I’m creating an integration test using microsoft Tuto Integration tests in ASP.NET Core public class WebAppFactory : WebApplicationFactory<Startup> { protected override void…
-
0
votes1
answer118
viewsQ: Docker name resolution
I am setting up a reverse proxy with Nginx + Docker. I have 02 machines that are in the bridge network. proxy : 172.17.0.2 app : 172.17.0.3 Both containers are configured with name server { listen…
-
4
votes3
answers470
viewsQ: Left Join with LINQ
I have two tables that come from different repositories. One comes from an API and I have one that comes from BD. I already have the two tables mapped to classes. I want to select all records from…
-
3
votes1
answer385
viewsQ: Self Relationship with Entity Framework 2.2
How to Make a Self Relationship with EF Core 2.2? I found a link that teaches to do with EF, but in EF does not have the Withoptional method. public class Menu { public int Id { get; set; } public…
-
0
votes1
answer321
viewsQ: Default value for property according to type Ef core
I have a code in which I define some properties according to the type of variable in EF6 protected override void OnModelCreating(DbModelBuilder modelBuilder) { modelBuilder.Properties().Where(p…
-
1
votes1
answer193
viewsQ: Map Object value to Entity Core
I have the class public class Email { public string Endereco { get; } public string NomeExibicao{ get; } } I am trying to map in EF Core using the following code builder.Property(e =>…
-
2
votes1
answer88
viewsQ: Conversion from Hex to Decimal using Two Add-on
I need to convert a string HEX for decimal, to string uses the Complement of Two standard and IEEE-754 to define the number of decimal places It is a tracking system, according to the manual to…
-
2
votes1
answer379
viewsQ: Convert SQL to LINQ
I have the following table CREATE TABLE `ultimaposicaorastreadores` ( `Id` CHAR(36) COLLATE utf8_bin NOT NULL DEFAULT '', `Serial` BIGINT(20) NOT NULL, `DataGps` DATETIME NOT NULL, PRIMARY KEY USING…
-
2
votes0
answers668
viewsQ: Error while updating Mysql.Data
I upgraded Mysql.Data and Mysql.Data.Entity from version 6.9.9 to version 6.10.4 and started getting the error below : Inheritance security rules were breached by the type:…
-
1
votes0
answers652
viewsQ: System.Invalidoperationexception
I have to convert a datatable to XML. My datatable has 68256 lines. When I serialize to XML, I get Outofmemoryexception: Exception_wasthrown error. Follow the code I’m using to make the conversion :…
-
0
votes1
answer589
viewsQ: Session Timeout MVC 5
I’m trying to implement Timeout Session in an MVC5 application. I have the following string on Web.config: <sessionState mode="InProc" cookieless="true" timeout="15" /> I created the class :…
-
0
votes1
answer2499
viewsQ: Generate Credit Card Token
I am using the Pagseguro API Git and I’m unable to find how to generate the credit card token to make the checkout transparent. In the example project you have the following command: // Sets a…
-
1
votes1
answer125
viewsQ: Relationship 1:N with RU
I have a table of units as below: public class Unity { public int Id {get;set } public string Name{ get; set; } } public class UsersRight { public int Id {get;set } public string Name{ get; set; }…
-
0
votes0
answers33
viewsQ: Receipt of HEX Via TCP
I need to convert a string that has been converted to HEX and sent via TCP to string. I tried the 2 ways below and only get string unscathed : public async void HandleConnections(TcpClient client) {…
-
0
votes0
answers125
viewsQ: Data Annotation with Real Values
I have the following model: [Display(Name = "Valor")] [DataType(DataType.Currency)] public decimal Valor { get; set; } View: <div class="form-group"> @Html.LabelFor(m => m.Valor, "Valor",…
-
2
votes1
answer121
viewsQ: Ioc with Web Service
I need to create a WS with Ioc. I created a new Web project with Web API dependencies ; I added a Web Service (asmx); I installed the Simpleinjector; The code went like this : [WebService(Namespace…
-
0
votes1
answer1342
viewsQ: Route in Google Maps using coordinates
I have this code for creating routes using Google Maps var map; var directionsDisplay; // Instanciaremos ele mais tarde, que será o nosso google.maps.DirectionsRenderer var directionsService = new…
-
1
votes1
answer87
viewsQ: Automapper with Ioc
public class Vigencia { public DateTime DataInicialVigencia { get; set; } public DateTime DataFinalVigencia { get; set; } public Guid VeiculoId { get; set; } public Guid RastreadorId { get; set; } }…
-
1
votes2
answers2740
viewsQ: Datapicker in Portuguese
I need to put a datapicker on a page, the same should be in Portuguese and in "dd/mm/yyyy format". <div class="form-group col-md-2"> <input type='text' class='form-control datepicker'…
-
0
votes1
answer40
viewsQ: Datapicker com @Html.Editorfor
I have the following model [DisplayName("Data Inicial Contrato")] [Required] [DataType(DataType.Date)] [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd}")] public…
-
1
votes1
answer88
viewsQ: Request performance using Html.Beginform versus jQuery AJAX
There is some performance gain when using jQuery to perform ajax requests relative to the post using Html.Beginform? @using (Html.BeginForm("Create", "Teste") { @Html.AntiForgeryToken()…
-
2
votes1
answer102
viewsQ: Calculated field with RU
I have two classes : public class Cliente { public int Id {get;set; public string Nome { get; set; } public string Email { get; set; } public string Telefone { get; set; } public string Celular {…
-
1
votes3
answers179
viewsQ: Select the Controller name via Javascript
I have the code below and would like to add to class="current" to <li></li> according to the controller I am accessing. I want to do this to make the item stand out. <ul…
-
2
votes0
answers241
viewsQ: MVC Component for Google Maps
I’m currently using the component Googlemap control for Asp.Net MVC to render Googlemaps maps. I am using this component because I will have to trace the route of a vehicle coming from the database…
-
1
votes1
answer127
viewsQ: Using Simpleject with Class Library
I am beginning in the use of simpleject for dependency injection. I created the Bootstrapper class to register containers: public class BootStrapper { public static void RegisterServices(Container…
-
0
votes0
answers262
viewsQ: Mysql with Entity Framework Code First
I have a project where I need to use Mysql as a database and EF6 with the CODE FIRST approach. I installed Mysql.Data.Entity 6.9.9 and Entityframework 6.1.3 My app.config looks like this:…
-
1
votes0
answers237
viewsQ: Code to receive file through POST
I’m making a webAPI to receive files via post. Customer will send via classic Vb with the following code: Set content = CreateObject("MSXML2.XMLHTTP.6.0") content.Open "POST", url, False…
-
6
votes1
answer6264
viewsQ: Upload file via POST to Webapi
I need to upload a file to a WebAPI, I am using the following code to upload public void Enviar() { WebRequest request = WebRequest.Create(url); request.Method = "POST"; byte[] byteArray =…
-
0
votes1
answer946
viewsQ: Reading headers in Webapi
I have a code that posts to a url and adds some parameters to the request header HttpWebRequest req = WebRequest.Create(new Uri(url)) as HttpWebRequest; req.Method = "POST"; req.ContentType =…
-
2
votes0
answers835
viewsQ: Error loading XML in Xdocument
I’m consuming a Webservice with the following code WebRequest request = WebRequest.Create(link); byte[] bytesToWrite = Encoding.ASCII.GetBytes(xml); request.Method = "POST"; request.ContentLength =…
-
1
votes1
answer122
viewsQ: How to embed a DLL into a winForms project
I need to incorporate a reference to a winforms project. I clicked on References, selected the reference and clicked on properties, then changed the property Embed Interop Types to true. When…
-
0
votes0
answers208
viewsQ: Log4net C# - does not save to database
I am using log4Net as a Log framework for a Winforms APP. public class Logger { private ILog _logErro; private const string LogErro = "LoggerErro"; public Logger() { Configure(); } private void…
-
1
votes1
answer77
viewsQ: Backgroundworker or Async
I need to develop a C# program where I will have slow processes. I have little experience with Winforms, I have more experience with WEB development. I am with the following doubt, the…
-
1
votes1
answer105
viewsQ: EF mapping for tables with variable name
I have several tables with the same structure, but with different names. Ex.: CREATE TABLE `log_historico_25072016` ( `lhis_id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `lhis_cvei_id` INT(10)…
-
1
votes1
answer714
viewsA: Example of Sendgrid V3 with attachment
I got it using sendgrid 1) PM> Install-Package SendGrid; 2) I added the following code : using System; using System.Web.Script.Serialization; using SendGrid; using SendGrid.Helpers.Mail; private…
-
1
votes1
answer714
viewsQ: Example of Sendgrid V3 with attachment
I am in need of an example code for sending email with attachment using sendgrid Web API v3. using (var client = new HttpClient()) { client.BaseAddress = new Uri("https://api.sendgrid.com/");…
-
1
votes1
answer125
viewsQ: Coordinate in MVC map
I need to show a map to the user and allow him to choose a location. After choosing the location I need to return the GPS coordinates (Latitude, Longitude) to the action. What’s the best way to do…
-
2
votes1
answer171
viewsQ: Delete Devexpress controls
I need to remove Devexpress controls from a project due to owning these components and not having the software license. I already deleted the components and references but when trying to compile…
-
4
votes1
answer114
viewsQ: Time Usage with EF 6
I have a class with the following property. public TimeSpan TempoIdeal { get; set; } Estou atribuindo esta propriedade com TempoIdeal = new TimeSpan(days: 3, hours: 15, minutes:10, seconds: 0);…
-
4
votes2
answers605
viewsQ: Field format for saving time
Which field should I use in SQL Server to save a duration? Ex.: 2days 23H 47min 00Sec. If you have an example with Fluent API it will help a lot.
-
2
votes1
answer70
viewsQ: Estimated travel time using dbgeography
It is possible to calculate the estimated travel time between two localities using dbgeography in C#?
-
1
votes1
answer78
viewsQ: Entity Framework 6 relationship
I have a class where I need to have two different relationships with the same table. public class Usuario { public int Naturalidade {set;get;} public int CidadeEndereco {set;get; } public class…
-
4
votes1
answer100
viewsQ: Textboxfor returned Null Post
I have a form where I query an API using jquery. The query returns the data and fills the textboxfor with this data : $.getJSON("//viacep.com.br/ws/" + cep + "/json/?callback=?", function (dados) {…