Posts by Renan Carlos • 1,594 points
55 posts
-
3
votes1
answer205
viewsA: search by ID for each item in the list
Well, first you have to map your entities. In the following way: public class Atendimento { public Guid AtendimentoId { get; set; } public Guid? ResponsavelPorAtender { get; set; } public Guid?…
-
1
votes1
answer32
viewsA: Code First Generating a foreign key
Well, in this case the Entity Framework is doing what was told to him. Or is it a relationship 1:N. So there is a need for visit control to "know" how to relate to many types of systems.…
-
0
votes1
answer379
viewsA: How to "read" return messages ASP.NET CORE WEB API
In that case, I strongly recommend the library Restsharp that already makes the work of deserialization of the object for you, what you need to do is in your client have the similar object, in your…
-
0
votes2
answers350
viewsA: How to configure Postgresql Autoincrement using EF Core
Following the documentation of Entity Framework Core, you can use the following .ValueGeneratedOnAdd(); builder.Property(p => p.Id) .ForNpgsqlUseSequenceHiLo(); .ValueGeneratedOnAdd();…
-
0
votes2
answers46
viewsA: How do I complete information that is in a complex JSON type?
The name of your properties json may be equal to the object you are receiving as already quoted(I find this particularly horrible, rs). I will show a more "elegant" way to resolve, using the…
-
0
votes1
answer184
viewsA: Edit/Update - ASP.NET MVC
There are some possibilities for this error to be happening... 1st - E.F is not identifying that there is a change in its entity, because it may be that it does not actually exist in the bank. 2nd -…
asp.net-mvcanswered Renan Carlos 1,594 -
1
votes1
answer154
viewsQ: Problem changing entity with E.F and Dapper
I have a Dapper query, where I search for an entity: var fatura = ObterPorClientedEDataVencimento(cobranca.ClienteId, cobranca.DataCobranca); The method and properties of my entity are in this Gist,…
-
3
votes1
answer118
viewsA: Displaying welcome message at navbar!
If you are using the template ASP.NET MVC with Identity, by default it already saves the Username with the email provided in the method Register, look at you: [AllowAnonymous]…
-
2
votes1
answer169
viewsQ: What are the "User" and "Cancellationtoken" parameters for?
I’m doing an implementation with the API from Google Drive, and in the code block: credenciais = GoogleWebAuthorizationBroker.AuthorizeAsync( GoogleClientSecrets.Load(stream).Secrets, new[] {…
-
6
votes2
answers6385
viewsQ: What does the HTTP Error 403.14 mean?
Well, I have a Web Api, which is configured as follows: WebApiConfig.Cs public static class WebApiConfig { public static void Register(HttpConfiguration config) { // Web API routes…
-
3
votes1
answer26
viewsQ: Error running Updade-Database command
When executing the command Update-Database Package Manager Console gets the following error: Value cannot be null. Parameter name: entitySet I have only one model in the project for now public class…
-
0
votes1
answer76
viewsA: Like I create a Dropdownlist for MVC5 ASP.NET
Come on... As there is very little information in the question, I will assume some things, in order to set an example that may be useful to you. I’ll give you a hint of how you can create your…
-
1
votes2
answers642
viewsQ: Get TD value by clicking on table
I have a table HTML horizontal, where I want to get the value of TD(time) when clicking on the line. Follow an image to try to illustrate better. By clicking on the line of 07:00 hours for example,…
-
2
votes2
answers121
viewsQ: How to screen a serialized object?
I’m trying to convert an object that contains a relationship and Serializando afim, to send it to View by Ajax. I have two related classes public class Eventos : IEntidade<EventosAuditoria> {…
-
4
votes1
answer58
viewsQ: Difference in EF exclusion forms
I want to know, what is the difference (if any) in the form of exclusion using the RU db.Contexto.Remove(objeto); db.SaveChanges(); And using the EntityState.Deleted; Db.Entry(objeto).State =…
-
0
votes0
answers96
viewsQ: Modify function return in Fullcalendar
I’m trying to make a script go to my database and return the data through a function. Follows: events: function(start, end, timezone) { // var convert =…
-
3
votes1
answer599
viewsQ: Fullcalendar displayed in wrong time
I’m implementing the FullCalendar in a project, I inserted some Events in the database and return them via Json. But when displaying them on the screen, they come with the correct time date, but the…
-
0
votes1
answer38
viewsQ: Error while restoring external database from Asp.net mvc application
I’m trying to restore a bank SQL that I created on a provider that does not have the option Webdeploy. And my goal is to boot a database using ASP.NET MVC with EntityFramework. Well, when you put…
-
1
votes3
answers7999
viewsQ: Update Error with Entityframework
When I try to update an object in the database, I get the error, Store update, Insert, or delete statement affected an Unexpected number of Rows (0). Entities may have been modified or Deleted Since…
-
2
votes1
answer167
viewsQ: Edit object, with related objects
I Have an Object Cliente relating to two other objects. [Table("Cliente")] public class Cliente { [StringLength(100, ErrorMessage = "Este campor permite apenas 100 caracteres"), Required] public…
-
2
votes1
answer77
viewsQ: Error in Transactionscope
I’m trying to accomplish a TransactionScope but it always gives me a mistake: Server Error in Application '/'. A Second Operation Started on this context before a Previous asynchronous Operation…
-
2
votes1
answer463
viewsQ: Error saving list of related objects
I’m using the BeginCollectionItem to insert objects related to a Cliente which I call Dependentes. When saving, I have the mistake: Violation of PRIMARY KEY constraint 'Pk_dbo.Dependents'. Not…
-
2
votes1
answer162
viewsQ: What does everything in this method do? (Mirror Audit in Entity Framework)
Well, following this excellent reply of the Gypsy, where he implements a form of Auditoria Espelho, where it is implemented in the DbSaveChanges() the following method: //Laço de repetição em…
-
7
votes1
answer605
viewsQ: How to login without using the Identity standard?
An update on Api of Facebook made the default login form of Identity stop working. The way I’m doing that stopped working is like this: public void ConfigureAuth(IAppBuilder app) {…
-
5
votes2
answers15150
viewsQ: Error login facebook
When I try to log in facebook through my application, gives the error: Blocked URL: Redirect failed because the Url used is not in the release list in the client’s Oauth settings application. Check…
-
3
votes2
answers473
viewsQ: Insert 1000 records into table with uniqueidentifier as primary key
I have to add, 1000 records in a given table. It contains the Field Name. I have the Script, which does the mass insertion. However, the primary key of this table is a uniqueidentifier(Guid()) how…
-
6
votes1
answer6325
viewsQ: Problem with Nuget Packages Visual Studio
Trying to compile the application, I come across the error: Severity Code Description Project File Line Suppression State Error This project References Nuget package(s) that are Missing on this…
-
1
votes3
answers121
viewsA: using of the unnecessary visual studio
Well, in addition to @Marconciliosouza’s reply, there are more errors in your code. Look at these lines: MySqlCommand = cmd = new MySqlCommand("select * from person", con); MySqlDataAdapter = adp =…
-
2
votes1
answer239
viewsA: Insert indented text in Textarea with Codemirror
You can use a HtmlHelper Supports rendering of controls HTML in an exhibition. In his View use it like this: @Html.Raw(Model.StringDoBanco)…
-
2
votes1
answer124
viewsQ: Display text coming from the database under @Html.Actionlink()
Well, I have the following scenario: I make an appointment at database and I bring a IEnumerable<> to the View: <section class="container"> <article class="row"> @foreach (var item…
-
3
votes1
answer177
viewsQ: How to integrate Tinymce with ASP.NET MVC
Implementation of the TinyMCE in ASP.NET MVC I found a problem when realizing image upload. The way I’m trying to implement is the following: I have a View with the Script who calls a Controller…
-
0
votes1
answer139
viewsA: Send External Login Data to Controller
With the help of Jbueno, I got the next answer. Well, this is a case of specifying HTML where it is not possible to possess a form within another. What needs to be done in this case is simply to…
-
1
votes1
answer139
viewsQ: Send External Login Data to Controller
I need to login through Facebook, I have the login page, which renders a @Html.Partial _Loginexternal Follow the code of both: @using EuVotoAf.Models @model LoginViewModel @{ ViewBag.Title = "Log…
-
2
votes1
answer625
viewsQ: Get specific login data through facebook
I am seeking to implement authentication through the facebook. Where I want to get more data audiences. I already have the default authentication set up. But I need something else, because it only…
-
2
votes1
answer108
viewsQ: Error while logging in using Facebook
Trying to login through facebook I come across the following error: Server Error in Application '/'. Undefined object reference for an object instance. Description: An untreated exception occurred…
-
2
votes2
answers2474
viewsQ: How to use Chart.Js with ASP.NET MVC
Well, I’m returning a list of and sending to View. And I need to implement this through a chart with Chart.js. I have the class Parents: [Table("Pais")] public class Pais { [Key] public Guid PaisId…
-
4
votes1
answer274
viewsQ: Error in Dapper query
Well, I’m trying to perform a consultation on Dapper and get the following error: The model item inserted in the dictionary is of type'System.Collections.Generic.List`1[Taxability…
-
1
votes1
answer31
viewsQ: Error Visual Studio 2015
When I run an application, or stop it. I come across this mistake: What is this, and how to solve ?…
visual-studio-2015asked Renan Carlos 1,594 -
1
votes1
answer56
viewsQ: Insert data with related objects
I’m trying to insert an object containing a relationship. User > Enterprise First I need to get the data from User in View of Create I’m doing it this way: public ActionResult Create() { var…
-
3
votes1
answer1199
viewsQ: How to get filename within folders in WEB API server
I have a directory Archive/Uploads And I would like to list all the files, within this directory I have N folders. what I’ve got so far is here. string path =…
-
3
votes1
answer763
viewsQ: How to Save Files to Separate Server by Extension
I have a WEB API who receives a file via POST follows the code of Controller: public async Task<HttpResponseMessage> Post() { // Ver se POST é MultiPart? if…
-
0
votes1
answer1894
viewsQ: Error: The request Entity’s media type 'Multipart/form-data' is not supported for this Resource
I’m trying to make a POST in a Webapi that is returning me the following error: The request Entity’s media type 'Multipart/form-data' is not supported for this Resource. Exceptionmessage: No…
-
3
votes1
answer2756
viewsQ: What is an Associative Table?
Well, I see some examples of code using associative tables. But I’m not sure what this term means, its applicability, the concept etc... What is an associative table?
-
1
votes1
answer68
viewsQ: Error when registering user
When I try to create a second user, with ASP.NET MVC, presents me with a mistake: Violation of PRIMARY KEY Constraint 'Pk_dbo.Aspnetusers'. Cannot Insert Duplicate key in Object 'dbo.Aspnetusers'.…
-
1
votes2
answers369
viewsQ: How to change project type on Github by Visual Studio
Well, I created a Reposótirio in the Github through the VisualStudio However, only when giving a Commit/Push he got the kind of project being JavaScript: But I want to change him to be the type C#.…
-
1
votes2
answers55
viewsQ: Best Way to Implement Dataannotations
There is some difference in the following implementations? [Required, StringLength(150, ErrorMessage = "Insira no máximo 150 caracteres")] [Index(IsUnique =true)] public int MyProperty { get; set; }…
-
4
votes3
answers267
viewsQ: Meaning of the term "Fluid Layout"
In research, I came across a series of articles talking about Design fluido.But most without clear explanations. I want to know what that means in development Frontend?…
-
2
votes1
answer145
viewsQ: Error opening Package Manage Console
When I open the Package Manage Console give me the following message: Join-Path : Cannot Convert 'System.Object[]' to the type 'System.String' required by Parameter 'Childpath'. Specified method is…
-
2
votes1
answer135
viewsQ: Error while logging in applications
Well, here’s the scenario: Have 2 applications ASP.NET MVC on the same project, which are using a Dominio in common. I’ll call it MVC1 and MVC2 to get better at exemplification. I installed the…
-
4
votes1
answer2349
viewsQ: What is the reference to Httpcontext.Getowincontext() ?
I had to abstract the Controllers of an application ASP.NET MVC for a Class Library because I’m using different technologies in the same application. However, I have the error:…